<?
require("config.php");

$label = "Catalog Request List";

$table="cus_catalog";


if ($action=="search"){

	$Query="SELECT 
	id,
	no,
	date,
	contact,
	company 
	FROM $table WHERE 

	company		LIKE '%$Customer%'		AND 
	contact		LIKE '%$Contact%'		
	ORDER BY id DESC";

	$r=myQuery($Query);

}else{

	$Query="SELECT 
	id,
	no,
	date,
	company,
	contact 
	FROM $table ORDER BY id DESC";

	$r=myQuery($Query);

}

require($rela_path . "inc/header1.php");
?>
<br>
<br>
<table width="90%" border="0" align="center">
  <tr>
    <td>
	
	
<FORM METHOD=GET ACTION="">		  
		  
<input name="action" type="hidden" value="search">
		  
	
	
	<table border="0">
        <tr> 
          <td><strong>Search by </strong></td>
          <td>&nbsp;</td>
        </tr>
        <tr> 
          <td>Customer:</td>
          <td><input type="text" class="text" name="Customer"></td>
        </tr>
        <tr> 
          <td>Customer Person :</td>
          <td><input type="text" class="text" name="Contact"></td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
          <td><input type="submit" class="button" name="Submit" value="  Go  "></td>
        </tr>
      </table>
	  
</form>	 
	  
	  
	  
	  </td>
  </tr>
</table>
<br>
<table width="90%" border="0" align="center" cellpadding="1" cellspacing="1" class="tb">
  <tr class="tbheader"> 
    <td width="3%"> 
      <div align="center">No.</div>
    </td>
    <td width="11%"> 
      <div align="center">Request No.</div>
    </td>
    <td width="12%"> 
      <div align="center">Date</div>
    </td>
    <td width="41%"> 
      <div align="center">Company</div>
    </td>
    <td width="23%"> 
      <div align="center">Contact Person</div>
    </td>
    <td width="10%"> 
      <div align="center">&nbsp;</div>
    </td>
  </tr>



<?
if ($r){	
	for ($i=0;$i<count($r);$i++){?>
  <tr class="tbcontent1"> 
    <td align="right"><?print($i+1)?></td>
    <td><?print($r[$i][1])?></td>
    <td><?print($r[$i][2])?></td>
    <td align="center"><?print($r[$i][3])?></td>
	<td align="center"><?print($r[$i][4])?></td>
    <td align="center"><a href="catalog_requrest_detail.php?id=<?print($r[$i][0])?>">Detail</a></td>
  </tr>
<?}
	
}?>





</table>
<br>
<?
require($rela_path . "inc/footer1.php");
?>
